﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _43继承
{
    class Fulei
    {
        public string _name;
        public string Name
        {
            get { 
                if (_name == "")
                {
                    _name = "**";
                }
                return _name; }
            set { _name = value; }
        }
        
        public int _age;
        public int Age
        {
            get { return _age; }
            set { 
                if(value<0 || value > 100)
                {
                   value = 0;
                }
                _age = value; }
        }

        public char _gender;
        public char Gender
        {
            get { return _gender; }
            set { _gender = value; }
        }

        public Fulei(string name,int age,char gender)
        {
            this.Name = name;
            this.Age = age;
            this.Gender = gender;
        }
    }
}
